<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/EmployeeAddress.php';
	
	/*
	* Class to create an employee address
	*/
	class CommandCreateEmployeeAddress extends CustomCommand {
		/*
		 * Constructor of the class
		 */
		public function __construct($startDate, $endDate, $ci) {
			$this -> employeeAddress = new EmployeeAddress($startDate, $endDate, $ci);
		}
		
		/*
		 * Method to execute to create an employee address
		 */
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$ieaad = $daoFactory -> getMySqlEmployeeAddressAccessDao();			
			$employeeAddressCreation = $ieaad -> createEmployeeAddress($this -> employeeAddress);
	
			$this -> result = $employeeAddressCreation;
		}
	}
?>